#include "transformation.h"

// =================================================================================================
// Screen Space transformation takes place here
// =================================================================================================
void SSTransformation(int width, int height, float depth, Plane& plane,
	                   float maxwidth, float maxheight, float& sample, 
					   unsigned int numsurfaces, PixelToaster::Pixel& pixel) {
    float x = (float(width)/maxwidth) * (2.0f) - 1.0f;
    float y = (float(height)/maxheight) * (-2.0f) + 1.0f;

    Vector4 origin = {0.0f, 0.0f, 0.0f, 1.0f};
    Vector4 dir = {x, y, depth, 1.0f};
    // check to see if this coordinate needs to be lighted up
	PlaneIntersection(origin, dir, plane, 3.0f, sample, pixel);
}
